const cheerio = require("cheerio");
const https = require("https");
const fs = require("fs");
const path = require("path");
var filePath = path.join(__dirname, "/movie.html");
var content = fs.readFileSync(filePath, "utf8");
content = content.toString("utf-8");

var $ = cheerio.load(content);

var arr = [];

$(".channel-detail.movie-item-title a").each((i, el) => {
    var obj = {};
    obj.movieId = $(el).attr("data-val").toString().split(":")[1].slice(0, -1);
    obj.movieName = $(el).text();
    arr.push(obj);
});
$(".channel-detail.channel-detail-orange").each((i, el) => {
    arr[i]["movieOrange"] = $(el).text();
});

console.log(arr);
